Service Function Chaining and Overlay Transport Loop Prevention

ABSTRACT

A method implemented by a service function forwarder (SFF) comprises receiving, by a receiver of the SFF, a service chain packet comprising a loop prevention field, the loop prevention field comprising a plurality of bits indicating whether an error has occurred during packet transmission, and determining, by a processor of the SFF, whether to forward the service chain packet based on a value in the loop prevention field being less than a predefined parameter, the predefined parameter based on a number of bits (n) in the loop prevention field.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present application claims priority to U.S. Provisional PatentApplication 62/428,296, filed Nov. 30, 2016 by Lucy Yong, et. al., andentitled “Service Function Chaining (SFC) and Overlay Transport LoopPrevention” and U.S. Provisional Patent Application 62/433,090, filedDec. 12, 2016 by Lucy Yong, et. al., and entitled “Service FunctionChaining (SFC) and Overlay Transport Loop Prevention,” both of which areincorporated herein by reference as if reproduced in its entirety.

STATEMENT REGARDING FEDERALLY SPONSORED RESEARCH OR DEVELOPMENT

Not applicable.

REFERENCE TO A MICROFICHE APPENDIX

Not applicable.

BACKGROUND

Service function chaining refers to a service deployment model thatapplies a sequence of network services to a data flow in a specificorder. A service chaining deployment model may insert Open SystemsInterconnection (OSI) Layer 4 (L4) to Layer 7 (L7) services indata-forwarding paths between peers. Some examples of L4 to L7 servicesmay include firewalls (FWs), wide area network (WAN) and applicationaccelerations, load balancing (LB), and network address translations(NATs). The L4 to L7 services are commonly provided by dedicatedhardware appliances located at a centralized location, for example, at adata center (DC) gateway. Thus, data-forwarding may direct all trafficto traverse through the DC gateway, which may cause a high volume oftraffic. The high volume of traffic caused by service function chainingmay also cause occasional packet transmission failures thatunnecessarily consume network resources.

SUMMARY

In an embodiment, the disclosure includes a method implemented by aservice function forwarder (SFF), comprising receiving, by a receiver ofthe SFF, a service chain packet comprising a loop prevention field, theloop prevention field comprising a plurality of bits indicating whetheran error has occurred during packet transmission, and determining, by aprocessor of the SFF, whether to forward the service chain packet basedon a value in the loop prevention field being less than a predefinedparameter, the predefined parameter based on a number of bits (n) in theloop prevention field. In some embodiments, the method further comprisesincrementing, by the processor, the value in the loop prevention fieldin response to determining that the value in the loop prevention fieldis less than the predefined parameter. In some embodiments, the methodfurther includes discarding, by the processor, the service chain packetin response to determining that the value in the loop prevention fieldis greater than or equal to the predefined parameter. In someembodiments, the predefined parameter is 2^(n-1), and wherein the loopprevention field comprises at least two bits, and/or the service chainpacket is further encapsulated with an overlay header comprising aTime-To-Live (TTL) field, wherein the TTL field comprises a maximumnumber of hops that the service chain packet is permitted to travel inan overlay network before being discarded. In some embodiments, themethod further includes decrementing a value in the TTL field beforetransmitting the service chain packet in the overlay network to a nextoverlay node when the value in the TTL field is greater than 0. In someembodiments, the method further includes discarding the service chainpacket at an overlay node when a value in the TTL field is equal to 0.

In an embodiment, the disclosure includes a SFF, comprising a receiverconfigured to receive a service chain packet comprising a loopprevention field, the loop prevention field comprising a plurality ofbits indicating whether an error has occurred during packettransmission, a processor coupled to the receiver and configured toincrement a value in the loop prevention field when the value in theloop prevention field is less than a predefined parameter, thepredefined parameter being based on a number of bits (n) in the loopprevention field, and a transmitter coupled to the processor andconfigured to transmit the service chain packet after incrementing thevalue in the loop prevention field. In some embodiments, a header of theservice chain packet comprises the loop prevention field, and/or thepredefined parameter is 2^(n-1), and wherein the loop prevention fieldcomprises at least two bits, and/or the service chain packet is furtherencapsulated with an overlay header comprising a Time-To-Live (TTL)field, wherein the TTL field comprises a maximum number of hops that theservice chain packet is permitted to travel before being discarded, andwherein the processor is further configured to decrement a value in theTTL field before transmitting the service chain packet when the value inthe TTL field is greater than 0, and/or the value in the loop preventionfield is 0 when the service chain packet is received from a classifier,and/or the value in the loop prevention field is 1 when the servicechain packet is received from a second SFF, and/or the value in the loopprevention field is 0 when the service chain packet is received from aservice function.

In an embodiment, the disclosure includes a SFF, comprising a receiverconfigured to receive a service chain packet comprising a loopprevention field, the loop prevention field comprising a plurality ofbits indicating whether an error has occurred during packettransmission, and a processor coupled to the receiver and configured todiscard the service chain packet when a value in the loop preventionfield is greater than or equal to a predefined parameter, the predefinedparameter corresponding to a number of bits (n) in the loop preventionfield. In some embodiments, a header of the service chain packetcomprises the loop prevention field, wherein the header is a NetworkService Header (NSH), and/or the predefined parameter is 2^(n-1), andwherein n is at least 2, and/or the service chain packet is furtherencapsulated with an overlay header comprising a Time-To-Live (TTL)field, wherein the TTL field comprises a maximum number of hops that theservice chain packet is permitted to travel before being discarded bythe SFF, and/or the processor is further configured to discard theservice chain packet when a value in the TTL field is equal to 0, and/orthe service chain packet is received from a previous SFF.

In an embodiment, the disclosure includes a service node (SN),comprising a receiver configured to receive a service chain packetcomprising a loop prevention field from a SFF, the loop prevention fieldcomprising a plurality of bits indicating whether an error has occurredduring transmission of the service chain packet, a processor coupled tothe receiver and configured to execute a service function on the servicechain packet, and set a value in the loop prevention field to 0 afterexecuting the service function on the service chain packet, and atransmitter coupled to the processor and configured to transmit theservice chain packet to the SFF.

In an embodiment, the disclosure includes a classifier, comprising areceiver configured to receive a data packet from a source, a processorcoupled to the receiver and configured to encapsulate the data packet tocomprise a service header and a create service chain packet, the serviceheader comprising a loop prevention field, the loop prevention fieldcomprising a plurality of bits to indicate whether an error has occurredduring transmission of the service chain packet, and set a value of theloop prevention field to 0, and a transmitter coupled to the processorand configured to transmit the service chain packet to a SFF aftersetting the value of the loop prevention field to 0.

For the purpose of clarity, any one of the foregoing embodiments may becombined with any one or more of the other foregoing embodiments tocreate a new embodiment within the scope of the present disclosure.

These and other features will be more clearly understood from thefollowing detailed description taken in conjunction with theaccompanying drawings and claims.

BRIEF DESCRIPTION OF THE DRAWINGS

For a more complete understanding of this disclosure, reference is nowmade to the following brief description, taken in connection with theaccompanying drawings and detailed description, wherein like referencenumerals represent like parts.

FIG. 1 is a schematic diagram of a network that implements servicefunction chaining according to an embodiment of the disclosure.

FIG. 2 is a schematic diagram of a network implementing a loopprevention mechanism while transmitting packets along a SFP according toan embodiment of the disclosure.

FIG. 3 is a schematic diagram of a network implementing a loopprevention mechanism while transmitting packets along a service functionpath (SFP) according to an embodiment of the disclosure.

FIG. 4 is a schematic diagram of an embodiment of a network element (NE)in a network implementing service function chaining.

FIG. 5 is a protocol diagram of an embodiment for performing loopprevention in a network implementing service function chaining.

FIG. 6 is a diagram of a service header according to an embodiment ofthe disclosure.

FIG. 7 illustrates an example of values in the loop prevention fieldwhen the loop prevention field includes 3 bits.

FIG. 8 is a method of loop prevention according to an embodiment of thedisclosure.

FIG. 9 is a method of loop prevention according to an embodiment of thedisclosure.

FIG. 10 is a method of loop prevention according to an embodiment of thedisclosure.

DETAILED DESCRIPTION

It should be understood at the outset that, although an illustrativeimplementation of one or more embodiments are provided below, thedisclosed systems and/or methods may be implemented using any number oftechniques, whether currently known or in existence. The disclosureshould in no way be limited to the illustrative implementations,drawings, and techniques illustrated below, including the exemplarydesigns and implementations illustrated and described herein, but may bemodified within the scope of the appended claims along with their fullscope of equivalent.

In a network that implements service function chaining, errors thatoccur during transmission of service chain packets are typicallydifficult to detect. For example, when service chain packets repeatedlypass through a Service Function Forwarder (SFF) without the SFF invokinga service function (SF), a loop is created in the transmission of theservice chain packet. Service chain packets that are transmitting on aloop may not reach the destination endpoint and may unnecessarilyconsume network resources.

Disclosed herein are embodiments directed to identifying when servicechain packets are transmitting in a loop and identifying when an erroroccurs during transmission of the service chain packets. In anembodiment, service chain packets include a service header with a loopprevention field. A classifier in the network sets an initial value inthe loop prevention field to 0 and transmits the service chain packet toan SFF. An SFF is configured to increment the value in the loopprevention field when the value is less than a predefined parameter. TheSFF then sends the service chain packet to a service node (SN), which isconfigured to reset the value in the loop prevention field only afterperforming a SF on the service chain packet. Each SFF on a servicefunction path (SFP) is configured to compare a value in the loopprevention field with a predefined parameter to determine whether tocontinue transmission of the service chain packet or discard the servicechain packet. Performing such a comparison at each SFF may prevent loopsor transmission errors from occurring and unnecessarily clogging networkresources within the network.

FIG. 1 is a schematic diagram of a SFP-enabled network 100 thatimplements service function chaining according to an embodiment of thedisclosure. A SFP-enabled network 100 that implements service functionchaining may generate SFPs for applications sending data packets from asource 118 (e.g., source 118A-C) to a destination 124 (e.g., destination124A-C). A SFP is an abstract sequenced set of SFs 121 (e.g., SFs121A-E) that a packet, a frame, and/or a traffic flow may traverse fordelivering an end-to-end service. SFs 121 refer to any network services,such as, for example, a firewall, an intrusion prevention system (IPS),or a server load-balancer. A SFP may be created according to SF-relatedinformation and network topology information. SF-related information mayinclude identifiers that identify SFs 121 in the SFP, locators (e.g.,network nodes) that identify instances of the SFs 121 in SFP-enablednetwork 100, administrative information (e.g., available memory,available capacity, and central processing unit (CPU) utilization), andcapability information. Network topology information may include thearrangement of the network nodes and network links in the SFP-enablednetwork 100. The SFP may include SFFs 112 (e.g., SFFs 112A-C) and SNs115 (e.g., SNs 115A-C). SNs 115 are network nodes at which the SFs 121or instances of the SFs 121 are located and SFFs 112 are network nodesthat forward data to the SNs 115 so that the SFs 121 may process thedata.

The SFP-enabled network 100 may comprise a Software Defined Network(SDN) controller 103 in data communication with a network 106. Theunderlying physical network of the network 106 may be any type oftransport network, such as an electrical network and/or an opticalnetwork, and may comprise one or more network domains. The network 106may employ any transport protocol, such as an Internet Protocol(IP)/User Datagram Protocol (UDP), suitable for transporting data overthe underlying physical network of the network 106. The network 106 mayemploy any type of network virtualization and/or network overlaytechnologies, such as a virtual extensible local area network (VXLAN).The network 106 may comprise a classifier 109, one or more SFFs 112, andone or more SNs 115. In an embodiment, the network 106 is an SDN-enablednetwork, where the network control is decoupled from forwarding and thecontrol plane is programmable through software controlled by a centralmanagement entity, such as the SDN controller 103. For example, the SDNcontroller 103 makes routing decisions and communicates the routingdecisions to all the network devices, such as the classifier 109, theSFFs 112, the SNs 115, and any other network nodes, in the network 106.

The source 118 and destination 124 in the SFP-enabled network 100 mayeach be a laptop computer, a tablet computer, a smart phone, a smarttelevision, network site, or a code division multiple access (CDMA)phone configured to request a SFP indicating a sequence of networkservices or SFs 121 for a data flow. The source 118 and destination 124may be coupled to the SDN controller 103 via a wired or wireless link.

The SDN controller 103 may be a virtual machine (VM), a dedicated host,a distributed system comprising a plurality of computing devices, or anyother device and/or system configured to manage the network 106. The SDNcontroller 103 performs SDN management and/or control operations, suchas determining forwarding paths in the network 106 and configuringnetwork nodes, such as the classifier 109, the SFFs 112, and the SNs115, with the forwarding instructions. In addition, the SDN controller103 may interact with other SFP entities to facilitate theimplementations of SFPs. For example, the SDN controller 103 may createan SFP to serve an application by determining a series of SFs 121, suchas firewall or policy routing, to form a composite service forimplementing the application.

The classifier 109 may be a VM, dedicated host, a network node, such asa router and/or a switch, or any other device configured to performclassification. For example, a classifier 109 may be a component withinan SFP ingress node, which is an SFP boundary node that handles trafficentering an SFP-enabled domain or an SFP proxy node in the SFPenabled-domain. In an embodiment, when the classifier 109 receives adata packet from a source 118 (e.g., source 118A-C), the classifier 109identifies an SFP and a service flow or a SFP for the data packet. Todirect the data packet along the identified SFP, the classifier 109generates a service chain packet to carry both the data packet and theSFP information, for example, by encapsulating the data packet with aservice header indicating the SFP information. One example of a serviceheader may be a network service header (NSH), as described in theInternet Engineering Task Force (IETF) draft document entitled “NetworkService Header (NSH),” dated Oct. 20, 2017 (“IETF Draft Document forNSH”), which is hereby incorporated by reference in its entirety. Anexample of the service header according to embodiments of the presentdisclosure will be further described in FIG. 6. The classifier 109 sendsthe service chain packet to a next SFF 112A in the identified serviceflow. It should be noted that the classifier 109 may perform additionalencapsulations over the Service chain packet, for example, according toa transport protocol and/or a network overlay (e.g., IP/UDP, VXLAN) inuse.

The SFFs 112 are any network nodes or devices, such as router, switches,and/or bridges, configured to forward packets and/or frames receivedfrom the network 106 to one or more SNs 115 associated with the SFFs 112according to information carried in the service header. When an SFF 112receives a packet carrying a service header from the network 106, theSFF 112 performs decapsulation (e.g., removal of transport header) toobtain the service chain packet. In an embodiment, the SFF 112 obtains avalue in a loop prevention field of the service chain packet todetermine whether a forwarding error has occurred during transmission ofthe service chain packet, as will be discussed more fully below. If aforwarding error has not occurred during transmission of the servicechain packet, the SFF 112 determines the appropriate SFs 121 forprocessing the packet. The SFF 112 determines the SNs 115 that providethe SFs 121 or instances of the SFs 121, for example, according toSF-to-locator mappings received from the SDN controller 103. The SFF 112forwards the service chain packet to the SNs 115 in an order (e.g., SF121A-E). In an embodiment, when the SNs 115 return the SF-processed datain the service chain packet, the SFF 112 is configured to increment thevalue in the loop prevention field, as will be discussed more fullybelow. The SFF 112 may then forward the SF-processed data to another SN115 or to a next SFF 112. When the SFF 112 is a last SFF (e.g., SFF112C) in the SFP, the SFF 112 may deliver the data processed by a lastSF (e.g., SF 121E) to a destination 124 (e.g., destination 124A-C).

The SNs 115 may be VMs, hypervisors, or any other devices configured toprocess packets and/or frames according to SF 121 types. In oneembodiment, an SN 115 may implement one or more SFs 121 which arelogical entities or software components. In another embodiment, multipleoccurrences of an SF 121 may be located in several SNs 115 in the sameSFP-enabled domain. In some embodiments, an SN 115 may be the same nodeas the classifier 109, where the SN 115 implements one or more SFs 121and classification. Some example SFs 121 provided by the SNs 115 mayinclude firewalls, WAN and application acceleration, server loadbalancing, lawful intercept, NAT, such as NAT-type 44 (NAT44) forInternet Protocol version 4 (IPv4) address translation or NAT-type 64(NAT64) for IP version 6 (IPv6) address translation, network prefixtranslation (NPT), hypertext transfer protocol (HTTP) header enrichmentfunction, and/or transport control protocol (TCP) optimizer. When an SN115 receives a service chain packet from the SFF 112, the SF 121 locatedat the SN 115 processes the data packet carried in the received servicechain packet. In some embodiments, the SN 115 is configured to set thevalue in the loop prevention field of the service chain packet to 0after processing the data packet, as will be discussed more fully below.

FIG. 2 is a schematic diagram of SFP-enabled network 100 implementing aloop prevention mechanism while transmitting packets along a SFP 203according to an embodiment of the disclosure. FIG. 2 shows an example ofa method of loop prevention while successfully transmitting a packetfrom a source 118A to a destination 124A. For example, source 118A sendsa request to the SDN controller 103 indicating a sequence of networkservices or SFs 121 for a data flow. The SDN controller 103 may computea shortest path through network 106 traversing a subset of the availableSFs 121 to determine the SFP 203 based on the request. For the exampleshown in FIG. 2, the subset of available SFs 121 included in SFP 203include SF 121B, SF 121C, and SF 121D. The SFFs 112 corresponding to theavailable SFs 121B, SF 121C, and SF 121D include SFF 112A, SFF 112B, andSFF 112C, respectively. The SDN controller 103 may assign SF 121B, SF121C, and SF 121D according to the request to create SFP 203.

The SDN controller 103 may transmit the SFs 121 and SFFs 112 that areincluded in SFP 203 to classifier 109 such that the classifier 109 isconfigured to encapsulate a service header 212 onto data packets 206received from an application executed at source 118 to be transmitted todestination 124 via network 106. For example, an application executed atsource 118A generates a data packet 206 comprising a payload. Source118A may transmit the data packet 206 to the classifier 109. Theclassifier 109 may determine the SFP 203 and a service flow or SFP forthe data packet 206 based on information received from the SDNcontroller 103. In an embodiment, the classifier 109 may encapsulate thedata packet 206 with a service header 212 to create a service chainpacket 209. The service chain packet 209 may comprise a service header212, as the NSH. The service header 212 may carry SFP traffic steeringinformation (e.g., service path information) and SFP metadatainformation. For example, the service header 212 may carry a servicepath identifier 215, which may be defined by the classifier 109 or theSDN controller 103 to uniquely identify SFP 203.

According to some embodiments, the service header 212 may furtherinclude a loop prevention field 220. The loop prevention field 220 maybe configured to indicate whether an error has occurred duringtransmission of the data packet 206 across network 106. For example, theloop prevention field 220 may be created by using a number (n) ofreserved bits that are available in a service header 212. In anembodiment, the classifier 109 sets a value in the loop prevention field220 to 0 after encapsulating the service header 212 onto the data packet206. For example, the value in the loop prevention field 220 may be setto 00 when the loop prevention field 220 includes 2 bits.

After the classifier 109 encapsulates the data packet 206 to create theservice chain packet 209, the classifier 109 may transmit the servicechain packet 209 to the SFF 112A according to the service pathidentifier 215. In an embodiment, the SFF 112A is configured to firstobtain the value in the loop prevention field 220 and compare the valuein the loop prevention field 220 to a predefined parameter. In anembodiment, the SFF 112A is configured to determine to continuetransmission of the service chain packet 209 when the value in the loopprevention field 220 is less than the predefined parameter. In anembodiment, the SFF 112A is configured to discard the service chainpacket 209, or discontinue transmission of the service chain packet 209,when the value in the loop prevention field 220 is greater than or equalto the predefined parameter.

In some embodiments, the loop prevention field 220 comprises at least 2bits. In some embodiments, the predefined parameter is based on thenumber of bits (n) in the loop prevention field 220 such that thepredefined parameter is in the range from 2^(n-1) to 2^(n)−1. Forexample, when the loop prevention field 220 has 2 bits, the predefinedparameter is equal to 2 or 3 depending on the embodiment. In this case,each of the SFFs 112 along an SFP 203 is configured to compare the valuein the loop prevention field 220 to the predefined parameter such as 2.The predefined parameter according to embodiments of the disclosure willbe more fully described below.

Continuing the example, SFF 112A obtains the service chain packet 209from the classifier 109 with the value of the loop prevention field 220being 0. SFF 112A may determine that the value of the loop preventionfield 220, which is 0, is less than the predefined parameter, such as 2.In this case, SFF 112A continues to transmit the service chain packet209 to SN 115A, which runs the SF 121B on the service chain packet 209.For example, the SF 121B is performed on the data packet 206 within theservice chain packet 209. When SN 115A successfully performs SF 121B onthe data packet 206, SN 115A may be configured to reset the value in theloop prevention field 220 to 0. When SN 115A is unable to successfullyperform SF 121B on the data packet 206 or SF 121B is unavailable at SN115A, the SN 115A does not change the value in the loop prevention field220.

As shown in FIG. 2, SN 115A is configured to transmit the service chainpacket 209 back to SFF 112A, where the value in the loop preventionfield 220 is 0 because SN 115A successfully performed SF 121B on datapacket 206. Similar to when SFF 112A received the service chain packet209 from the classifier 109, SFF 112A may again increment the value inthe loop prevention field 220 to 1. After incrementing, SFF 112Aforwards the service chain packet 209 to SFF 112B based on the servicepath identifier 215 in the service header 212.

SFF 112B receives the service chain packet 209 and determines whetherthe value in the loop prevention field 220 received from SFF 112A isless than the predefined parameter. For example, SFF 112B determinesthat the value in the loop prevention field 220, which is 1, is lessthan the predefined parameter, such as 2. In this case, SFF 112B againincrements the value in the loop prevention field 220 to 2 and thencontinues to transmit the service chain packet 209 to SN 115B. SN 115Bmay be configured to execute SF 121C on the service chain packet 209.After SN 115B successfully performs SF 121C on the service chain packet209, SN 115B may be configured to reset the value in the loop preventionfield 220 to 0 and then transmit the service chain packet 209 back toSFF 112B. Upon receiving the service chain packet 209 where the value inthe loop prevention field 220 is 0, SFF 112B may again increment thevalue in the loop prevention field 220. For example, SFF 112B incrementsthe value in the loop prevention field 220 to 1 and forwards the servicechain packet 209 to SFF 112C based on the service path identifier 215 inthe service header 212.

SFF 112C receives the service chain packet 209 and determines whetherthe value in the loop prevention field 220 is less than the predefinedparameter. For example, SFF 112C determines that the value in the loopprevention field 220, which is 1, is still less than the predefinedparameter, such as 2. In this case, SFF 112C may increment the value inthe loop prevention field 220 to 2 and then transmit the service chainpacket 209 to SN 115C. SN 115C may be configured to execute SF 121D onthe service chain packet 209. After SN 115C successfully performs SF121D on the data packet 206, SN 115C may be configured to reset thevalue in the loop prevention field 220 to 0 and then transmit theservice chain packet 209 back to SFF 112C. Upon receiving the servicechain packet 209 where the value in the loop prevention field 220 is 0,SFF 112C may again increment the value in the loop prevention field 220.In an embodiment in which SFF 112C determines that SFF 112C is the lastSFF 112 before the data packet 206 is sent to the destination 124A, SFF112C may decapsulate the service chain packet 209 and send the datapacket 206 to destination 124A.

As shown in FIG. 2, the value in the loop prevention field 220 isincremented each time the service chain packet 209 reaches a SFF 112 andresets to 0 each time the service chain packet 209 leaves an SN 115after successfully performing a service on the service chain packet 209.Each time a SFF 112 receives the service chain packet 209, the SFF 112determines whether the value in the loop prevention field 220 is lessthan a predetermined parameter. When the value in the loop preventionfield 220 is less than a predetermined parameter, SFF 112 determinesthat an error has not occurred during transmission of the service chainpacket 209, as shown in FIG. 2.

FIG. 3 is a schematic diagram of SFP-enabled network 100 implementing aloop prevention mechanism while transmitting packets along a SFP 203according to an embodiment of the disclosure. FIG. 3 shows an example ofa method 300 of loop prevention when a failure occurs duringtransmission of a packet from a source 118A to a destination 124A.Source 118A, destination 124A, SDN controller 103, classifier 109, SFFs112A-C, SNs 115A-C, and SFs 121A-E in method 300 operate similar to howthey did in method 200, except that SFF 112C determines that an erroroccurs during transmission of service chain packet 209 and discards theservice chain packet 209.

Similar to method 200, in method 300 the classifier 109 encapsulates thedata packet 206 to include a service header 212, creating the servicechain packet 209. The classifier 109 is configured to set the value inthe loop prevention field 220 of the service header 212 to 0. Theclassifier 109 transmits the service chain packet 209 to SFF 112A. SFF112A first obtains the value in the loop prevention field 220 andcompares the value with the predefined parameter, such as, in thisexample, 2. Since the value in the loop prevention field 220 is 0 afterbeing received from the classifier 109, the value in the loop preventionfield 220 is less than the predefined parameter. SFF 112A transmits theservice chain packet 209 to SN 115A, which performs SF 121B on the datapacket 206. SN 115A resets the value in the loop prevention field 220 to0 after successfully performing SF 121B on the service chain packet 209and then forwards the service chain packet 209 back to SFF 112A. SFF112A again increments the value in the loop prevention field 220 to 1and then forwards the service chain packet 209 to SFF 112B.

As shown in FIG. 3, SFF 112B receives the service chain packet 209 fromSFF 112A but does not transmit the service chain packet 209 to SN 115Bto invoke SF 121C. There may be many reasons why SFF 112B receives theservice chain packet 209 but does not invoke a SF 121. For example, SFF112B may not actually be connected to a SN 115 that has a SF 121 whichis to be performed on a data packet 206. In this case, SFF 112B hasreceived the service chain packet 209 by mistake, and has thus createdan error in transmitting the packet from the source 118A to thedestination 124A. In another case, SF 121C may be experiencing a failuresuch that SF 121 cannot transmit the service chain packet 209 to SN 115Bto execute SF 121C. In this case, SN 115B merely receives the servicechain packet 209 without performing a SF 121 on the packet and thenforwards the service chain packet 209 to another SFF 112C, therebycausing a loop to occur within network 106. An error occurs among SFFs112 when one SFF 112 receives a service chain packet 209 and forwardsthe service chain packet 209 to another SFF 112 without performing a SF121 on the service chain packet 209. Such errors may result in loopsoccurring while transmitting the data packet 206 from the source 118 tothe destination 124.

When SFF 112B receives the service chain packet 209, the SFF 112B firstdetermines whether the value in the loop prevention field 220 is lessthan the predefined parameter. Since the value in the loop preventionfield 220 is 1, which is still less than 2, the SFF 112B determines thatthe service chain packet 209 may continue to be transmitted. The SFF112B is configured to increment the value in the loop prevention field220 to 2 even though the SFF 112B does not transmit the service chainpacket 209 to SN 115. After incrementing the value in the loopprevention field 220, SFF 112B transmits the service chain packet 209 toSFF 112C.

Upon receiving the service chain packet 209, SFF 112C determines whetherthe value in the loop prevention field 220 is less than the predefinedparameter. The SFF 112B incremented the value in the loop preventionfield 220 to 2, such that when SFF 112C receives the service chainpacket 209, the value in the loop prevention field 220 is no longer lessthan the predefined parameter, which is also 2. The SFF 112C may beconfigured to discard the service chain packet 209 when the value in theloop prevention field 220 is greater than or equal to the predefinedparameter. For example, SFF 112C may discontinue transmission of theservice chain packet 209 when the value in the loop prevention field 220is greater than or equal to the predefined parameter.

Similar to method 200, the value in the loop prevention field 220 isincremented each time the service chain packet 209 reaches a SFF 112 andreset to 0 each time the service chain packet 209 leaves an SN 115 aftersuccessfully performing a service on the service chain packet 209. Whenan SFF 112 forwards a service chain packet 209 without invoking a SF121, SFF 112 still increments the value in the loop prevention field220. Each time a SFF 112 receives the service chain packet 209, the SFF112 determines whether the value in the loop prevention field 220 isless than a predetermined parameter. When the value in the loopprevention field 220 is greater or equal to the predetermined parameter,SFF 112 determines that an error has occurred during transmission of theservice chain packet 209, as shown in FIG. 3. In such a case, the SFF112 discards the service chain packet 209.

FIG. 4 is a schematic diagram of an embodiment of a network element (NE)400 in a SFP-enabled network 100. For instance, the NE 400 may be aclassifier 109, SFF 112, SN 115, source 118, destination 124, or SDNcontroller 103. The NE 400 may be configured to implement and/or supportthe loop prevention mechanisms described herein. The NE 400 may beimplemented in a single node or the functionality of NE 400 may beimplemented in a plurality of nodes. One skilled in the art willrecognize that the term NE encompasses a broad range of devices of whichNE 400 is merely an example. The NE 400 is included for purposes ofclarity of discussion, but is in no way meant to limit the applicationof the present disclosure to a particular NE embodiment or class of NEembodiments. At least some of the features and/or methods described inthe disclosure may be implemented in a network apparatus or module suchas an NE 400. For instance, the features and/or methods in thedisclosure may be implemented using hardware, firmware, and/or softwareinstalled to run on hardware. As shown in FIG. 4, the NE 400 comprisesone or more ingress ports 410 and a receiver unit (Rx) 420 for receivingdata, at least one processor, logic unit, or CPU 430 to process thedata, a transmitter unit (Tx) 440 and one or more egress ports 450 fortransmitting the data, and a memory 460 for storing the data.

The processor 430 may comprise one or more multi-core processors and becoupled to a memory 460, which may function as data stores, buffers,etc. The processor 430 may be implemented as a general processor or maybe part of one or more application specific integrated circuits (ASICs)and/or digital signal processors (DSPs). The processor 430 may comprisesa loop prevention module 470, which may perform processing functions ofclassifier 109, SFF 112, SN 115, source 118, destination 124, or SDNcontroller 103 and implement methods 200, 300, 500, 800, 900, and 1000,as discussed more fully below, and/or any other method discussed herein.As such, the inclusion of the loop prevention module 470 and associatedmethods and systems provide improvements to the functionality of the NE400. Further, the loop prevention module 470 effects a transformation ofa particular article (e.g., the network) to a different state. In analternative embodiment, the loop prevention module 470 may beimplemented as instructions stored in the memory 460, which may beexecuted by the processor 430.

The memory 460 may comprise a cache for temporarily storing content,e.g., a random-access memory (RAM). Additionally, the memory 460 maycomprise a long-term storage for storing content relatively longer,e.g., a read-only memory (ROM). For instance, the cache and thelong-term storage may include dynamic RAMs (DRAMs), solid-state drives(SSDs), hard disks, or combinations thereof. The memory 460 may beconfigured to store identified misconfigurations 480, which may include,for example, the service path identifiers 215 of SFPs that have beenidentified as resulting in an error during transmission of packets. Thememory 460 may also be configured to store the predefined parameter 490,which is limited by the number of bits (n) in the loop prevention field220.

It is understood that by programming and/or loading executableinstructions onto the NE 400, at least one of the processor 430 and/ormemory 460 are changed, transforming the NE 400 in part into aparticular machine or apparatus, e.g., a multi-core forwardingarchitecture, having the novel functionality taught by the presentdisclosure. It is fundamental to the electrical engineering and softwareengineering arts that functionality that can be implemented by loadingexecutable software into a computer can be converted to a hardwareimplementation by well-known design rules. Decisions betweenimplementing a concept in software versus hardware typically hinge onconsiderations of stability of the design and numbers of units to beproduced rather than any issues involved in translating from thesoftware domain to the hardware domain. Generally, a design that isstill subject to frequent change may be preferred to be implemented insoftware, because re-spinning a hardware implementation is moreexpensive than re-spinning a software design. Generally, a design thatis stable that will be produced in large volume may be preferred to beimplemented in hardware, for example in an ASIC, because for largeproduction runs the hardware implementation may be less expensive thanthe software implementation. Often a design may be developed and testedin a software form and later transformed, by well-known design rules, toan equivalent hardware implementation in an ASIC that hardwires theinstructions of the software. In the same manner as a machine controlledby a new ASIC is a particular machine or apparatus, likewise a computerthat has been programmed and/or loaded with executable instructions maybe viewed as a particular machine or apparatus.

FIG. 5 is a protocol diagram of a method 500 for performing loopprevention in a network implementing service function chaining, such asSFP-enabled network 100. The method 500 is implemented by a source 118,classifier 109, SFF 112A, SN 115A, SFF 112B, and SFF 112C. The method500 is initiated when a source 118 transmits a request to a SDNcontroller 103 for the SDN controller 103 to determine a SFP 203 fordata packets 206 transmitted from the source 118 to a destination 124.At step 505, the source 118 transmits a data packet 206 to a classifier109. For example, the Tx 440 of the source 118 transmits the data packet206 to the classifier 109. A Rx 420 of the classifier 109 may receivethe data packet 206.

At step 510, the classifier 109 may identify a SFP 203 for the datapacket 206 based on information received from the SDN controller 103. Insome embodiments, the classifier 109 may encapsulate the data packet 206to include a service header 212, thereby creating the service chainpacket 209. In some embodiments, the service header 212 includes a loopprevention field 220 that indicates whether an error has occurred duringtransmission of the data packet 206. In an embodiment, the loopprevention field 220 comprises at least 2 bits. The classifier 109 maybe configured to set the value in the loop prevention field 220 to 0.

At step 515, the classifier 109 may transmit the service chain packet209 to SFF 112A based on the SFP 203 for the data packet 206. Forexample, the Tx 440 of the classifier 109 transmits the service chainpacket 209 with the value in the loop prevention field 220 being set to0. The Rx 420 of the SFF 112A may receive the service chain packet 209from the classifier 109. At step 520, the SFF 112A determines whetherthe value in the loop prevention field 220 is less than the predefinedparameter 490. For example, the loop prevention module 470 executed bythe processor 430 is configured to determine whether the value in theloop prevention field 220 is less than the predefined parameter 490. Asshown in FIG. 5, the predefined parameter 490, which is limited by thenumber of bits (n) in the loop prevention field 220, may be equal to2^(n)−1. The loop prevention field 220 used in the example shown inFIGS. 1-3 includes 2 bits, and the predefined parameter 490 in theexample above is equal to 2. Since the value in the loop preventionfield 220 is 0 when the SFF 112A receives the service chain packet 209from the classifier 109, the SFF 112A may determine that an error hasnot occurred during transmission of the service chain packet 209 andcontinue transmission. At step 520, the SFF 112A also increments thevalue in the loop prevention field 220 to 1 when the value in the loopprevention field 220 is less than the predefined parameter 490. Forexample, the loop prevention module 470 executed by the processor 430 isconfigured to increment the value in the loop prevention field 220 whenthe value in the loop prevention field 220 is less than the predefinedparameter 490.

At step 525, the SFF 112A transmits the service chain packet 209 to theSN 115A to invoke an SF 121 at the SN 115A. For example, the Tx 440 ofthe SFF 112A transmits the service chain packet 209 to the SN 115A. Atstep 530, SN 115A invokes SF 121 to perform a network function on thedata packet 206 within the service chain packet 209. For example, theprocessor 430 of the SN 115A invokes SF 121 to perform the networkfunction on the data packet 206. At step 530, the SF 121 successfullyperforms the network function on the data packet 206 and then resets thevalue in the loop prevention field 220 to 0. For example, the processor430 of the SN 115A resets the value in the loop prevention field 220 to0. In the case where the network function cannot be performed on thedata packet 206 by SF 121 at SN 115A, the value in the loop preventionfield 220 may remain the same and is not reset.

At step 535, the SN 115A transmits the service chain packet 209 back toSFF 112A. For example, the Tx 440 of the SN 115A transmits the servicechain packet 209 back to SFF 112. When the SN 115A successfullyperformed SF 121 on the service chain packet 209, the value in the loopprevention field 220 is 0, and at step 540, the SFF 112A increments thevalue in the loop prevention field 220 to 1. In the case where the SN115A is unable to perform SF 121 on the service chain packet 209, theSFF 112A may still increment the value in the loop prevention field 220.For example, the loop prevention module 470 executed by the processor430 is configured to increment the value in the loop prevention field220.

At step 545, the SFF 112A transmits the service chain packet 209 to SFF112B where the loop prevention field 220 includes the value of 1. Forexample, the Tx 440 transmits the service chain packet 209 to SFF 112B.At step 550, the SFF 112 determines whether the value in the loopprevention field 220 is less than the predefined parameter 490. Forexample, the loop prevention module 470 executed by the processor 430 isconfigured to determine whether the value in the loop prevention field220 is less than the predefined parameter 490. The predefined parameter490 in the example shown in FIG. 3 is 2. Since the value in the loopprevention field 220 is 1 when the service chain packet 209 is receivedfrom SFF 112A, the SFF 112B may determine that an error has not occurredduring transmission of the service chain packet 209 and continuetransmission. At step 520, the SFF 112B does not perform a SF 121 on thedata packet 206 of the service chain packet 209 for one of the variousreasons discussed above with reference to FIG. 3. However, even though aSF 121 is performed on the service chain packet 209, the SFF 112B isstill configured to increment the value in the loop prevention field 220to 2. For example, the processor 430 increments the value in the loopprevention field 220.

At step 555, the SFF 112B transmits the service chain packet 209 to SFF112C. For example, Tx 440 of SFF 112B transmits the service chain packet209 to SFF 112C. A Rx 420 of SFF 112C receives the service chain packet209 where the value in the loop prevention field 220 is 2. At step 560,SFF 112C determines whether the value in the loop prevention field 220is less than the predefined parameter 490. For example, the loopprevention module 470 executed by the processor 430 is configured todetermine whether the value in the loop prevention field 220 is lessthan the predefined parameter 490. Here, the value in the loopprevention field 220 is 2 when the service chain packet 209 is receivedfrom SFF 112B. SFF 112C may determine that the value in the loopprevention field 220 is greater than or equal to the predefinedparameter 490 and discard, or discontinue transmission of, the servicechain packet 209.

FIG. 6 is a diagram of a service header 212 according to an embodimentof the disclosure. For example, the service header 212 is a NSH asdescribed in the IETF Draft Document for NSH, which is alreadyincorporated by reference above in the description for FIG. 1. Theservice header 212 includes service path information and optionallymetadata that are added to a data packet 206 and used to create aservice plane. Subsequently, an outer transport encapsulation is imposedon the service header 212, which is used for network forwarding. Theclassifier 109 adds the service header 212 onto the data packet 206, andthe last SFF 112C in the SFP 203 removes the service header 212.

As shown in FIG. 6, the service header 212 comprises a version field603, an operations, administration, and maintenance (OAM) field 606, aloop prevention field 220, a length field 609, a metadata (MD) typefield 610, a next protocol field 612, a service path identifier field615, a service index field 618, and reserved bits 621. As should beappreciated, the service header 212 may not include all of these fieldsand/or may include additional fields. The version field 603 indicates aversion and is used to ensure backward compatibility going forward withfuture service header 212 specification updates. The OAM field 606indicates whether the data packet 206 is an OAM packet.

The MD type field 610 indicates a format of the metadata being carriedin the service chain packet 209. The next protocol field 612 indicatesthe protocol type of the encapsulated data. The service path identifierfield 615 includes a service path identifier that uniquely identifies aSFP 203. SFFs 112 and SNs 115 use this service path identifier to selectthe SF 121 to perform on the service chain packet 209. The service indexfield 618 includes the service index that provides a location within theSFP 203. The service index is used in conjunction with the service pathidentifier for SFP selection for determining the next SFF 112, SN 115,and/or SF 121 in the path. The reserved bits 621 may be extra bits thatdo currently not carry information.

As shown in FIG. 6, the loop prevention field 220 occupies two or morereserved bits that are available in the service header 212. Althoughonly 2 bits are shown in the loop prevention field 220 of FIG. 6, theremay be any number of bits used for the loop prevention field 220. Insome embodiments, the number of bits (n) used for the loop preventionfield 220 corresponds to the predefined parameter 490. If n bits areused in a loop prevention field 220, then 2^(n)−1 is a maximum number ofconsecutive SFFs 112 permitted for an SFP 203. In an embodiment, thepredefined parameter 490 is 2^(n-1) such that the value in the loopprevention field 220 is compared to 2^(n-1). For the examples shown inFIGS. 2-3 and 5, the predefined parameter 490 is 2 because n=2. In someembodiments, SFP resilience to SF 121 failures is considered by usingmore than 2 bits in the loop prevention field 220. For example, when aSF 121 fails, service chain packets 209 may pass through more than twoSFFs 112, or middle relay components, without reaching an SF 121. Toallow for the service chain packets 209 to pass through more than twoSFFs 112 to find a working SF 121, the loop prevention field 220 mayinclude more than 2 bits. In this embodiment, each of the SFFs 112 areconfigured to determine the number of bits (n) in the loop preventionfield 220 when a service chain packet 209 is received. The SFFs 112 maythen be configured with the predefined parameter 490 based on the numberof bits (n) in the range 2^(n-1) to 2^(n)−1. Each of the SFFs 112 areconfigured to increment the value in the loop prevention field 220 basedon whether the value currently in the loop prevention field 220 is lessthan the computed predefined parameter 490.

FIG. 7 illustrates a method 700 of loop prevention according to anembodiment of the disclosure. FIG. 7 shows examples of values 710 (e.g.,values 710 A-E) in the loop prevention field 220 when the loopprevention field 220 includes 3 bits. When the loop prevention field 220includes 3 bits, the predefined parameter 490 may be 4 (2³⁻¹). In such acase, each SFF 112A-C determines whether the value 710 in the loopprevention field 220 is less than 4. As shown in FIG. 7, the value 710may be a binary value.

As shown in FIG. 7, when the classifier 109 encapsulates the data packet206 to include the service header 212 and creates the service chainpacket 209, the classifier 109 sets the value 710A in the loopprevention field 220 to 0 (shown as the binary value 000 in FIG. 7) andtransmits the service chain packet 209 to SFF 112A. SFF 112A firstdetermines that the value 710A (0) is less than 4, increments the value710A to be 1 (shown as the binary value 001 in FIG. 7), then transmitsthe service chain packet 209 to SN 115A to perform a SF 121 on theservice chain packet 209. SN 115 resets the value 710 back to 0, andsends the service chain packet 209 back to SFF 112A. SFF 112A againincrements the value 710B to 1 (shown as the binary value 001 in FIG. 7)and transmits the service chain packet 209 to SFF 112B.

SFF 112B also determines that the value 710B (1) is less than 4, but SFF112B does not transmit the service chain packet 209 to a SN 115 toinvoke an SF 121. Instead, SFF 112B increments the value 710C to 2(shown as the binary value 010 in FIG. 7) and transmits the servicechain packet 209 to SFF 112C. SFF 112C also determines that the value710C (2) is less than 4 and does not transmit the service chain packet209 a SN 115 to invoke an SF 121. SFF 112C instead increments the value710D to 3 (shown as the binary value 0011 in FIG. 7) and transmits theservice chain packet 209 back to SFF 112B. SFF 112B determines that thevalue 710 (3) is less than 4 and again does not transmit the servicechain packet 209 to a SN 115. SFF 112B increments the value 710E to 4(shown as the binary value 100 in FIG. 7) and transmits the servicechain packet 209 to SFF 112C.

In traditional SFP-enabled networks, the loop occurring between SFF 112Band SFF 112C during the transmission of the service chain packet 209 maynot be detected because a loop prevention field 220 is typically notincluded in a service header 212. Embodiments of the disclosure hereinprevent the loop between SFF 112B and SFF 112C from continuouslyoccurring because SFF 112C is configured to discard the service chainpacket 209 after determining that the value 710E (4) is greater than orequal to the predefined parameter 490 of 4. As shown in FIG. 7, the 3bit loop prevention field 220 permits the service chain packet 209 toaccount for some SF 121 failures while still maintaining the ability todiscard packets once an error in packet transmission is detected.

In an embodiment, the service chain packet 209 may be additionallyencapsulated with an overlay header to be transmitted across overlaynodes in an overlay network. In an embodiment, the overlay header mayinclude a Time-to-Live (TTL) field that may be more than 2 bits. Forexample, a TTL field may be 8 bits in length. The TTL field may be setby an ingress node on an overlay path to include a value indicating amaximum number of hops for an overlap path that may be used for loopdetection. The initial value in the TTL field may be configurable orspecific to one or more overlay paths. If no initial value in the TTLfield is provided, a default initial TTL value may be used. Each overlaynode on an overlay path may be configured to decrement a value in theTTL field by 1 prior to forwarding the overlay packet to another overlaynode. When an overlay node receives an overlay packet, the overlay nodemay first determine whether the value in the TTL field is 0. The overlaynode may be configured to discard the overlay packet when the value inthe TTL field is 0. The overlay node may be configured to continuetransmission of the overlay packet along the overlay path when the valuein the TTL field is greater than 0.

In an embodiment, the TTL field may be included in the overlay headerwhen an inner header with a TTL value is not used in the service chainpacket 209. In an embodiment, the TTL field may be included in theoverlay header when an inner header with a TTL value does not exist inthe service chain packet 209. In an embodiment, the TTL field may beincluded in the overlay header when an inner header with a TTL fieldincludes a large value, for example, to cover delivery after a finaloverlay hop. In this embodiment, the maximum number of hops for anoverlay path may be smaller than the large value.

In an embodiment, a service header 212 used for service functionchaining may include a TTL field, for example, in some of the reservedbits 621 of the service header 212. For example, the TTL field in theservice header 212 may include a value for a maximum number of SFF 112hops for an SFP. The TTL field here may also be used for service planeloop detection similar to the loop prevention field 220. The initial TTLvalue in the TTL field may be set by the classifier 109 or the SDNcontroller 103. The initial TTL value may be configurable or setspecifically for one of the SFPs 203. If an initial value for the TTLfield is not explicitly provided, the default initial TTL value of 63may be used. Each SFF 112 involved in forwarding a service chain packet209 must decrement the value in the TTL field by 1 prior to forwardinglookup and transmitting the service chain packet 209 to another SFF 112.In one embodiment, the SFF 112 is configured to discard the servicechain packet 209, or discontinue forwarding the service chain packet209, if the value in the TTL field is 0 upon receiving the service chainpacket 209 from another SFF 112. In one embodiment, the SFF 112 isconfigured to discard the service chain packet 209 if the value in theTTL field is 0 after decrementing is 0.

FIG. 8 is a method 800 of loop prevention according to an embodiment ofthe disclosure. The method 800 may be implemented by the SFF 112. Themethod 800 may be implemented when, for example, a classifier 109transmits a service chain packet 209 to the SFF 112 after encapsulatingthe data packet 206 to include the service header 212. At step 803, theSFF 112 receives the service chain packet 209 comprising a loopprevention field 220. For example, Rx 420 of SFF 112 receives theservice chain packet 209. The loop prevention field 220 comprises aplurality of bits indicating whether an error has occurred duringtransmission of the service chain packet 209. In an embodiment where theSFF 112 receives the service chain packet 209 from the classifier 109,the value 710 in the loop prevention field 220 is 0. In an embodimentwhere the SFF 112 receives the service chain packet 209 from anotherSFF, the value 710 in the loop prevention field 220 may be greater than0.

At step 806, the SFF 112 determines whether to forward the service chainpacket 209 based on a value 710 in the loop prevention field 220 beingless than a predefined parameter 490. For example, the loop preventionmodule 470 in the processor 430 determines whether to forward theservice chain packet 209. In an embodiment, SFF 112 is configured toincrement a value 710 in the loop prevention field 220 when the value710 in the loop prevention field 220 is less than the predefinedparameter 490. In an embodiment, the SFF 112 is configured to discardthe service chain packet 209 when the value 710 in the loop preventionfield 220 is greater than or equal to the predefined parameter 490.

FIG. 9 is a method 900 of loop prevention according to an embodiment ofthe disclosure. The method 900 may be implemented by SN 115. The method900 may be implemented when, for example, an SFF 112 transmits a servicechain packet 209 to the SN 115. At step 903, the SN 115 receives theservice chain packet 209 comprising the loop prevention field 220 froman SFF 112. For example, the Rx 420 receives the service chain packet209. The loop prevention field 220 comprises a plurality of bitsindicating whether an error has occurred during transmission of theservice chain packet 209. At step 906, the SN 115 executes an SF 121 onthe service chain packet 209. For example, the loop prevention module470 in the processor 430 of SN 115 executes an SF 121 on the data packet206 in the service chain packet 209. At step 909, SN 115 sets a value710 in the loop prevention field 220 to 0 after executing the SF 121 onthe service chain packet 209. For example, the loop prevention module470 in the processor 430 of SN 115 sets a value 710 in the loopprevention field 220 to 0 after executing the SF 121 on the servicechain packet 209. In an embodiment, if the SF 121 is unavailable orfails to execute a network service on the service chain packet 209, thevalue 710 in the loop prevention field 220 remains unchanged. At step912, the SN 115 transmits the service chain packet 209 back to the SFF112. For example, the Tx 440 transmits the service chain packet 209 backto the SFF 112.

FIG. 10 is a method 1000 of loop prevention according to an embodimentof the disclosure. The method 1000 may be implemented by a classifier109. The method 1000 may be implemented when, for example, theclassifier 109 receives a data packet 206 from a source 118. At step1003, the classifier 109 receives a data packet 206 from a source 118.For example, the Rx 420 receives the data packet 206 from a source 118.At step 1006, the classifier 109 encapsulates the data packet 206 tocomprise the service header 212 and create a service chain packet 209.For example, the loop prevention module 470 in the processor 430encapsulates the data packet 206 to comprise the service header 212 andcreate a service chain packet 209. The service header 212 comprises theloop prevention field 220, where the loop prevention field 220 comprisesa plurality of bits to indicate whether an error has occurred duringtransmission of the service chain packet 209. At step 1009, theclassifier 109 sets a value 710 of the loop prevention field 220 to 0.For example, the loop prevention module 470 in the processor 430 setsthe value 710 of the loop prevention field 220 to 0. At step 1012, theclassifier 109 transmits the service chain packet 209 to a SFF 112 aftersetting the value 710 in the loop prevention field 220 to 0.

In an embodiment, the disclosure includes a means for receiving aservice chain packet comprising a loop prevention field, the loopprevention field comprising a plurality of bits indicating whether anerror has occurred during packet transmission, and determining whetherto forward the service chain packet based on a value in the loopprevention field being less than a predefined parameter, the predefinedparameter based on a number of bits (n) in the loop prevention field.

In an embodiment, the disclosure includes a means for receiving aservice chain packet comprising a loop prevention field, the loopprevention field comprising a plurality of bits indicating whether anerror has occurred during packet transmission, a means for incrementinga value in the loop prevention field when the value in the loopprevention field is less than a predefined parameter, the predefinedparameter being based on a number of bits (n) in the loop preventionfield, and a means for transmitting the service chain packet afterincrementing the value in the loop prevention field.

In an embodiment, the disclosure includes a means for receiving aservice chain packet comprising a loop prevention field, the loopprevention field comprising a plurality of bits indicating whether anerror has occurred during packet transmission, and a means fordiscarding the service chain packet when a value in the loop preventionfield is greater than or equal to a predefined parameter, the predefinedparameter corresponding to a number of bits (n) in the loop preventionfield.

In an embodiment, the disclosure includes a means for receiving aservice chain packet comprising a loop prevention field from a SFF, theloop prevention field comprising a plurality of bits indicating whetheran error has occurred during transmission of the service chain packet, ameans for executing a service function on the service chain packet, ameans for setting a value in the loop prevention field to 0 afterexecuting the service function on the service chain packet, and a meansfor transmitting the service chain packet to the SFF.

In an embodiment, the disclosure includes a means for receiving a datapacket from a source, a means for encapsulating the data packet tocomprise a service header and create a service chain packet, the serviceheader comprising a loop prevention field, the loop prevention fieldcomprising a plurality of bits to indicate whether an error has occurredduring transmission of the service chain packet, a means for setting avalue of the loop prevention field to 0, and a means for transmittingthe service chain packet to a SFF after setting the value of the loopprevention field to 0.

While several embodiments have been provided in the present disclosure,it should be understood that the disclosed systems and methods might beembodied in many other specific forms without departing from the spiritor scope of the present disclosure. The present examples are to beconsidered as illustrative and not restrictive, and the intention is notto be limited to the details given herein. For example, the variouselements or components may be combined or integrated in another systemor certain features may be omitted, or not implemented.

In addition, techniques, systems, subsystems, and methods described andillustrated in the various embodiments as discrete or separate may becombined or integrated with other systems, modules, techniques, ormethods without departing from the scope of the present disclosure.Other items shown or discussed as coupled or directly coupled orcommunicating with each other may be indirectly coupled or communicatingthrough some interface, device, or intermediate component whetherelectrically, mechanically, or otherwise. Other examples of changes,substitutions, and alterations are ascertainable by one skilled in theart and could be made without departing from the spirit and scopedisclosed herein.

What is claimed is:
 1. A method implemented by a service functionforwarder (SFF), comprising: receiving, by a receiver of the SFF, aservice chain packet comprising a loop prevention field, the loopprevention field comprising a plurality of bits indicating whether anerror has occurred during packet transmission; and determining, by aprocessor of the SFF, whether to forward the service chain packet basedon a value in the loop prevention field being less than a predefinedparameter, the predefined parameter based on a number of bits (n) in theloop prevention field.
 2. The method of claim 1, wherein the determiningwhether to forward the service chain packet comprises incrementing, bythe processor, the value in the loop prevention field in response todetermining that the value in the loop prevention field is less than thepredefined parameter.
 3. The method of claim 1, wherein the determiningwhether to forward the service chain packet discarding, by theprocessor, the service chain packet in response to determining that thevalue in the loop prevention field is greater than or equal to thepredefined parameter.
 4. The method of claim 1, wherein the predefinedparameter is 2^(n-1), and wherein the loop prevention field comprises atleast two bits.
 5. The method of claim 1, wherein the service chainpacket is further encapsulated with an overlay header comprising aTime-To-Live (TTL) field, wherein the TTL field comprises a maximumnumber of hops that the service chain packet is permitted to travel inan overlay network before being discarded.
 6. The method of claim 5,further comprising decrementing a value in the TTL field beforetransmitting the service chain packet in the overlay network to a nextoverlay node when the value in the TTL field is greater than
 0. 7. Themethod of claim 5, further comprising discarding the service chainpacket at an overlay node when a value in the TTL field is equal to 0.8. A service function forwarder (SFF), comprising: a receiver configuredto receive a service chain packet comprising a loop prevention field,the loop prevention field comprising a plurality of bits indicatingwhether an error has occurred during packet transmission; and aprocessor coupled to the receiver and configured to process the servicechain packet based a value in the loop prevention field being comparedto a predefined parameter, the predefined parameter being based on anumber of bits (n) in the loop prevention field.
 9. The SFF of claim 8,wherein the service chain packet is processed by the processor toincrement the value in the loop prevention field when the value in theloop prevention field is less than the predefined parameter, and whereinthe SFF further comprises a transmitter coupled to the processor andconfigured to transmit the service chain packet after incrementing thevalue in the loop prevention field.
 10. The SFF of claim 8, wherein theservice chain packet is processed by the processor to discard theservice chain packet when the value in the loop prevention field isgreater than or equal to the predefined parameter.
 11. The SFF of claim8, wherein the service chain packet is encapsulated with an overlayheader comprising a Time-To-Live (TTL) field, wherein the TTL fieldcomprises a maximum number of hops that the service chain packet ispermitted to travel before being discarded by the SFF, and wherein theprocessor is further configured to discard the service chain packet whena value in the TTL field is equal to
 0. 12. The SFF of claim 8, whereinthe service chain packet is encapsulated with an overlay headercomprising a Time-To-Live (TTL) field, wherein the TTL field comprises amaximum number of hops that the service chain packet is permitted totravel before being discarded, and wherein the processor is furtherconfigured to decrement a value in the TTL field before transmitting theservice chain packet when the value in the TTL field is greater than 0.13. The SFF of claim 8, wherein a header of the service chain packetcomprises the loop prevention field.
 14. The SFF of claim 8, wherein thepredefined parameter is 2^(n-1), and wherein the loop prevention fieldcomprises at least two bits.
 15. The SFF of claim 8, wherein the valuein the loop prevention field is 0 when the service chain packet isreceived from a classifier.
 16. The SFF of claim 8, wherein the value inthe loop prevention field is 1 when the service chain packet is receivedfrom a second SFF.
 17. The SFF of claim 8, wherein the value in the loopprevention field is 0 when the service chain packet is received from aservice function.
 18. The SFF of claim 8, wherein the service chainpacket is received from a previous SFF.
 19. A service node (SN),comprising: a receiver configured to receive a service chain packetcomprising a loop prevention field from a service function forwarder(SFF), the loop prevention field comprising a plurality of bitsindicating whether an error has occurred during transmission of theservice chain packet; a processor coupled to the receiver and configuredto: execute a service function on the service chain packet; and set avalue in the loop prevention field to 0 after executing the servicefunction on the service chain packet; and a transmitter coupled to theprocessor and configured to transmit the service chain packet to theSFF.
 20. A classifier, comprising: a receiver configured to receive adata packet from a source; a processor coupled to the receiver andconfigured to: encapsulate the data packet to comprise a service headerand create service chain packet, the service header comprising a loopprevention field, the loop prevention field comprising a plurality ofbits to indicate whether an error has occurred during transmission ofthe service chain packet; and set a value of the loop prevention fieldto 0; and a transmitter coupled to the processor and configured totransmit the service chain packet to a service function forwarder (SFF)after setting the value of the loop prevention field to 0.